﻿Imports System.IO
Imports System.Drawing

Public Class IconsAndPaths
    Public IconsPathsDi As New List(Of ModuleInfo)

    Public Overloads Function GetIconsAndPaths(ByVal _ModulesList As List(Of ModulePermissions)) As List(Of ModuleInfo)

        Dim mp As ModulePermissions

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.PatientVisit Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.PatientVisit, "Images/PatientVisit.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.PatientRegistration Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.PatientRegistration, "Images/kuzer.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.PatientAdmission Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.PatientAdmission, "Images/Admission.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.PatientDischarge Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.PatientDischarge, "Images/Discharge.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.Billing Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.Billing, "Images/business.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.Purchase Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.Purchase, "Images/kaddressbook.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.PurchaseOrder Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.PurchaseOrder, "Images/parallels.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.Alerts Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.Alerts, "Images/alert.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.ItemsServices Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.ItemsServices, "Images/warehause.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.Employee Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.Employee, "Images/personal.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.Vendors Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.Vendors, "Images/gvim.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.Lookups Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.Lookups, "Images/starthere.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.Doctors Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.Doctors, "Images/assistant.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.Departments Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.Departments, "Images/katomic.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.Rooms Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.Rooms, "Images/kbounce.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.Wards Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.Wards, "Images/parallels.png")

        'mp = (From ml In _ModulesList Where ml.Name = HMSFormName.Complaints Select ml).FirstOrDefault
        'If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.Complaints, "Images/easymoblog.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.Banks Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.Banks, "Images/ksirtet.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.UsersList Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.UsersList, "Images/personal.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.UserProfile Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.UserProfile, "Images/Community Help.png")

        mp = (From ml In _ModulesList Where ml.Name = HMSFormName.billTemplates Select ml).FirstOrDefault
        If mp IsNot Nothing Then If mp.View = True Then AddToDictionary(HMSFormName.billTemplates, "Images/kate.png")

        Return IconsPathsDi
    End Function

    Public Overloads Function GetIconsAndPaths() As List(Of ModuleInfo)
        AddToDictionary(HMSFormName.PatientVisit, "Images/PatientVisit.png")
        AddToDictionary(HMSFormName.PatientRegistration, "Images/PatientRegistration.png")
        AddToDictionary(HMSFormName.NextAppointment, "Images/schedule.png")
        AddToDictionary(HMSFormName.PatientAdmission, "Images/Admission.png")
        AddToDictionary(HMSFormName.PatientDischarge, "Images/Discharge.png")
        AddToDictionary(HMSFormName.Billing, "Images/Billing.png")
        AddToDictionary(HMSFormName.Purchase, "Images/Purchase.png")
        AddToDictionary(HMSFormName.PurchaseOrder, "Images/PurchaseOrder.png")
        AddToDictionary(HMSFormName.Medicines, "Images/Medicines.png")
        AddToDictionary(HMSFormName.ItemsServices, "Images/ItemsServices.png")
        AddToDictionary(HMSFormName.Diagnosis, "Images/Diagnosis.png")
        AddToDictionary(HMSFormName.Alerts, "Images/alert.png")
        AddToDictionary(HMSFormName.Employee, "Images/Employee.png")
        AddToDictionary(HMSFormName.Vendors, "Images/Vendors.png")
        AddToDictionary(HMSFormName.Lookups, "Images/Lookups.png")
        AddToDictionary(HMSFormName.Doctors, "Images/Doctors.png")
        AddToDictionary(HMSFormName.Departments, "Images/Departments.png")
        AddToDictionary(HMSFormName.Rooms, "Images/Rooms.png")
        AddToDictionary(HMSFormName.Wards, "Images/Wards.png")
        'AddToDictionary(HMSFormName.Complaints, "Images/Diseases.png")
        AddToDictionary(HMSFormName.Banks, "Images/Banks.png")
        AddToDictionary(HMSFormName.billTemplates, "Images/billTemplates.png")
        AddToDictionary(HMSFormName.Investigations, "Images/Investigations.png")
        AddToDictionary(HMSFormName.Findings, "Images/Findings.png")
        AddToDictionary(HMSFormName.Problems, "Images/Problems.png")
        'AddToDictionary(HMSFormName.TreatmentProcedures, "Images/TreatmentProcedures.png")
        AddToDictionary(HMSFormName.PrescriptionTemplate, "Images/PrescriptionTemplate.png")
        AddToDictionary(HMSFormName.UsersList, "Images/UsersList.png")
        AddToDictionary(HMSFormName.UserProfile, "Images/UserProfile.png")
        AddToDictionary(HMSFormName.CompanyInfo, "Images/CompanyInfo.png")
        Return IconsPathsDi
    End Function

    Private Sub AddToDictionary(ByVal displayName As String, ByVal tileIconPath As String)
        Dim objMod = (From icon As ModuleInfo In IconsPathsDi Where icon.ModuleTitle.Trim.ToLower = displayName.Trim.ToLower Select icon).FirstOrDefault

        If objMod Is Nothing Then
            IconsPathsDi.Add(New ModuleInfo With {.ModuleTitle = displayName, .tileIconPath = tileIconPath})
        End If
    End Sub
End Class

Public Enum FormsList
    None
    Billing
    PatientRegistration
    PatientAdmission
    PatientVisit
    PatientDischarge
    Employee
    PurchaseOrder
    Purchase
    CompanyInfo
    ItemsServices
    Lookup
    Vendor
    Users
    UserProfile
    Doctors
    Departments
    Rooms
    Wards
    Complaints
    Banks
    BillTemplate
    Medicines
    Investigations
    Findings
    Problems
    TreatmentProcedures
    PrescriptionTemplate
    NextAppointment
    NextContact
    NextRecall
    Diagnosis
End Enum

Public Enum LookupsList
    None
    PatientList
    ItemsServicesList
    InventoryItemsList
    UOMList
    VendorList
    EmpList
    Ledgers
    BillCharges
    EmpType
    MaritalStatus
    Relationship
    Specialization
    DoctorType
    ComplaintsList
End Enum

Public Enum ReportsList
    None
    Billing
    Employee
    Purchase
    PurchaseOrder
    ItemsServices
    PatientRegistration
    Vendors
    Doctors
    Departments
    Rooms
    Wards
    Complaints
    Banks
End Enum